<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>php基础语法</title>
    <script type="text/javascript">
    var arr = [123,456];
    console.log(arr[0]);
    console.log(arr[1]);
    var arr1 = new array(789,111);
    console.log(arr1[0]);
    console.log(arr1[1]);
    

    //二维数组
    var arr = [];
    arr[0] = [1,2,3];
    arr[1] = [4,5,6];
    arr[2] = [7,8,9];
    console.dir(arr);
    for(var i =0;i<arr.length;i++){
        for(var j=0;j<arr[i].length;j++){
            console.log('索引值：'+i+','+j+'------'+arr[i][j]);
        }
    }
    </script>
</head>
<body>
    <div>测试内容</div>
    <div>
    <?php
    // $arr = array(1,2,3,4,5);
    // $arr= array("hello","hi");
    // // print_r($arr); 
    // echo $arr[0];
    // echo '<br>';
    // echo $arr[1];

    // $arr1 = array("username"=>"zhangsan","age"=>"12","sex"=>"male")
    // print_r($arr1);  
    // echo '<br>';
    // echo $arr1["username"];
    // echo '<br>';
    // var_dump($arr1);

    //=------------------------------------------------

    //二维数组
    $arr = array();
    $arr[0] = array(11,22,33);
    $arr[1] = array(44,55,66);
    $arr[2] = array(77,88,99);
    print_r($arr);


    $arr = array();
    $arr['apple'] = array('color'=>'red','shape'=>'round');
    $arr['orange'] = array('color'=>'orenge','shape'=>'round');
    $arr['banana'] = array('color'=>'yellow','shape'=>'long');
    print_r($arr);
    ?>
    </div>
</body>
</html>